package com.geeklan.smart.utils;

import java.util.ArrayList;

public class ListUtils {
    public static String convertArrayListToFormattedString(ArrayList<String> list) {
        StringBuilder builder = new StringBuilder();
        builder.append("[");

        for (int i = 0; i < list.size(); i++) {
            builder.append("\\\"").append(list.get(i)).append("\\\""); // 添加转义的双引号
            if (i < list.size() - 1) {
                builder.append(", ");
            }
        }

        builder.append("]");
        return builder.toString();
    }
}
